package com.smart.manager.work.entities.models;

import com.smart.common.entities.core.BaseLongModel;
import com.smart.manager.product.entities.views.BasicPlaceView;
import com.smart.manager.work.entities.enums.StaffStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.time.LocalDateTime;

/**
 * 管家管理
 * @author leo
 * @date 2023/09/10
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Accessors(chain = true)
@Table(name = "work_basic_staff")
public class BasicStaff extends BaseLongModel {

    @ApiModelProperty("管家代码")
    private String code;


    @ApiModelProperty("管家头像")
    private String avatar;


    @ApiModelProperty("管家名称")
    private String name;

    @ApiModelProperty("所属场地")
    @ManyToOne
    @JoinColumn(name = "site",referencedColumnName = "code")
    private BasicPlaceView site;

    @ApiModelProperty("管家手机号")
    private String phone;

    @ApiModelProperty("管家密码")
    private String password;

    @ApiModelProperty("管家状态")
    private StaffStatus status;

    @ApiModelProperty("是否是管理员")
    private Boolean isManage;

    @ApiModelProperty("刷新令牌过期时间")
    private LocalDateTime refreshExpiredTime;

    @ApiModelProperty("身份刷新令牌")
    private String refreshToken;

    @ApiModelProperty("openId")
    private String openId;

    @ApiModelProperty("显示排序")
    private Integer sort;

}
